// 今年作业总数
getAllTask();
function getAllTask() {
	if(sessionStorage.getItem("sid") != 'undefined'){
		$.ajax({
			url: "http://localhost:8080/Online-student/TaskController/getAllCount",
			type: "get",
			data: {
				sid: sessionStorage.getItem("sid")
			},
			dataType: "json",
			success: function(result) {
				console.log(result);
				$("#getAllCount").html('<p>' + result.data+ '</p>');
			}
		})
	}
}
// 公告总条数 -- 公告信息
limitoneAffiche();
function limitoneAffiche() {
	$.ajax({
		url: "http://localhost:8080/Online-student/AfficheController/limitoneAffiche",
		type: "get",
		data: {},
		dataType: "json",
		success: function(result) {
			console.log(result);
			if (result.data.length > 0) {
				$("#limitoneAffiche").html('<p>' + result.data[0].countone + '</p>');
			}
		}
	})
}
// 某学生已提交作业
getAllCountsTask();
function getAllCountsTask() {
	if(sessionStorage.getItem("sid") != 'undefined'){
		$.ajax({
			url: "http://localhost:8080/Online-student/TaskStudentController/getAllCountsTask",
			type: "get",
			data: {
				sid: sessionStorage.getItem("sid")
			},
			dataType: "json",
			success: function(result) {
				if (result.status == 0) {
					$("#getAllCountsTask").html('<p>' + result.data + '</p>');
				}
			}
		})
	}
}
//未提交的作业数
getAllNosubmit();
function getAllNosubmit() {
	if(sessionStorage.getItem("sid") != 'undefined'){
		$.ajax({
			url: "http://localhost:8080/Online-student/TaskStudentController/getAllNosubmit",
			type: "get",
			data: {
				sid: sessionStorage.getItem("sid")
			},
			dataType: "json",
			success: function(result) {
				console.log(result);
				if (result.status == 0) {
					$("#getAllCountEs").html('<p>' + result.data[0].count + '</p>');
				}
			}
		})
	}
}